/*
 * @Description: 
 * @Version: 1.0
 * @Autor: 陈德平
 * @Date: 2020-04-23 09:28:00
 * @LastEditors: 陈德平
 * @LastEditTime: 2020-04-23 11:21:15
 */
import {mapConfig} from '../config'
let style = {
  version: 8,
  sources: { 
    bd: mapConfig.source,//深色地图
    //暂无外网
    // szzb: mapConfig.source_szzb,//深圳周边
    // zj: mapConfig.source1,//道路注记
    // bd_qs: mapConfig.source_qs,//浅色地图
    // xqd_zj: mapConfig.source2,//兴趣点注记 
    areas: {
        type: "geojson",
        data: {
            features: [],
            type: "FeatureCollection"
        }
    },
    bianjieIn: {
        type: "geojson",
        data: {
            features: [],
            type: "FeatureCollection"
        }
    },
    bianjieOut: {
        type: "geojson",
        data: {
            features: [],
            type: "FeatureCollection"
        }
    },
    //遮盖数据源
    coveredSource: {
        type: "geojson",
        data: {
            features: [],
            type: "FeatureCollection"
        }
    },
    //wfs遮盖数据源
    wfsCoveredSource: {
        type: "geojson",
        data: {
            features: [],
            type: "FeatureCollection"
        }
    },
    //渐变线
    bianjieLIneSource: {
        type: "geojson",
        data: {
            features: [],
            type: "FeatureCollection"
        }
    },
  },
  layers: [
      //深圳周边图层 
    //   {
    //       id: "szzb_layer",
    //       type: "raster",
    //       source: "szzb",
    //       "raster-opacity": 1,
    //       minzoom: 10,
    //       maxzoom: 15
    //   },
      // 底图图层
      {
          id: "base_layer",
          type: "raster",
          source: "bd",
          "raster-opacity": 1
      },
      //底图浅色图层
    //   {
    //       id: "base_layer_qs",
    //       type: "raster",
    //       source: "bd_qs",
    //       "raster-opacity": 1,
    //       layout: {
    //           "visibility": "none"
    //       }
    //   },
      {
          id: "bianjieIn_layer",
          type: "line",
          source: "bianjieIn",
          layout: {
              "line-join": "round",
              "line-cap": "round"
          },
          paint: {
              "line-color": "#00a2ff",
              "line-width": 2
          }
      },
      //为了鼠标移动显示坐标
      {
          id: "bianjieMouseIn_layer",
          type: "line",
          source: "bianjieIn",
          layout: {
              "line-join": "round",
              "line-cap": "round"
          },
          paint: {
              "line-opacity": 0,
              "line-color": "#00a2ff",
              "line-width": 20
          }
      },
      //移动内边界高亮面
      {
          id: "fillIn_layer",
          type: "fill",
          source: "bianjieIn",
          layout: {
              visibility: "visible"
          },
          paint: {
              "fill-opacity": 0,
              "fill-color": "#00a2ff",
              "fill-outline-color": "yellow"
          }
      },
      {
          id: "bianjie_layer",
          type: "line",
          source: "bianjieOut",
          layout: {
              "line-join": "miter",
              "line-cap": "square"
          },
          paint: {
              "line-color": "#00c6ff",
              "line-width": 2,
              "line-dasharray": [4, 10] // 虚线
          }
      },
      {
          id: "area_Layer",
          type: "line",
          source: "areas",
          layout: {
              "line-join": "round",
              "line-cap": "round"
          },
          paint: {
              // "line-pattern":"rediamge", 
              "line-color": "#00a2a2",
              "line-width": 2
          },
          filter: ["==", "areacode", ""]
      },
      //遮盖图层 空隙
      {
          'id': 'coveredLayer',
          type: "fill",
          source: "coveredSource",
          layout: {
          },
          paint: {
              "fill-opacity": 1,
              "fill-color": "#02123c",
              //"fill-outline-color": "yellow"
              // "fill-extrusion-opacity": 1,
              // "fill-extrusion-color": '#02123c',
              // "fill-extrusion-height": ["get", "height"]
          },
      },
      // wmts注记图层
    //   {
    //       id: "base1_layer",
    //       type: "raster",
    //       source: "zj",
    //       minzoom: 14,
    //       "raster-opacity": 1
    //   },
      // 兴趣点注记图层
    //   {
    //       id: "base_xqd_layer",
    //       type: "raster",
    //       source: "xqd_zj",
    //       minzoom: 14,
    //       "raster-opacity": 1
    //   },
      //遮盖图层 wfs----解决注记压盖问题
      {
          'id': 'wfsCoveredLayer',
          type: "fill",
          source: "wfsCoveredSource",
          layout: {
          },
          paint: {
              "fill-opacity": 1,
              "fill-color": "#02123c",
              //"fill-color": "red",
              // "fill-extrusion-opacity": 1,
              // "fill-extrusion-color": '#02123c',
              // "fill-extrusion-height": ["get", "height"]
          },
      },
      //渐变线图层
      {
          id: "bianjieLine_layer",
          type: "line",
          source: "bianjieLIneSource",
          layout: {
              "line-join": "round",
              "line-round-limit": 10000,
              "line-cap": "round"
          },
          paint: {
              "line-opacity": .3,
              "line-color": "#23387a",
              "line-width": 16,
              "line-offset": -8,
              // "line-pattern":"rediamge", 
          }
      },
  ]
};

export {style}